package Cluster;

import java.util.ArrayList;
import java.util.List;

import MyLoader.MyLoader;
import XmlLoader.FGObjProcess;
import XmlLoader.FGObjectTrajectoryStructure;

public class ClusterMain {

	public static void main(String[] args) {
		//load XML data
		FGObjProcess fgObj = new FGObjProcess(args[1]);
		List<String> list_objIndex = fgObj.ACT004_getStringList(args[0]);
		List<FGObjectTrajectoryStructure> list = new MyLoader().ACT001_getListOfObj(args[1], list_objIndex);
		//trajectory structure transformation
		ArrayList<Trajectory> listTraj = new ArrayList<Trajectory>();
		int index = 0;
		while(index < list.size()) {
			listTraj.add(new Trajectory(list.get(index), 0, 0, list.get(index).GET002_nNumberOfPoint()));
			index = index + 1;
		}
		//do cluster
		ClusteringProcess cp = new ClusteringProcess();
		cp.ACT001_doCluster(ClusteringProcess.MATRIC_DTW, 88277.0, 3, listTraj);
		//show result
		cp.ACT002_showResult();
	}
}
